<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <!-- <el-form-item label="是否末级" prop="bDepEnd">
        <el-input
          v-model="queryParams.bDepEnd"
          placeholder="请输入是否末级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="部门名称 " prop="cDepName">
        <el-input
          v-model="queryParams.cDepName"
          placeholder="请输入部门名称 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="编码级次" prop="iDepGrade">
        <el-input
          v-model="queryParams.iDepGrade"
          placeholder="请输入编码级次"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="负责人编码" prop="cDepPerson">
        <el-input
          v-model="queryParams.cDepPerson"
          placeholder="请输入负责人编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门属性 " prop="cDepProp">
        <el-input
          v-model="queryParams.cDepProp"
          placeholder="请输入部门属性 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电话 " prop="cDepPhone">
        <el-input
          v-model="queryParams.cDepPhone"
          placeholder="请输入电话 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="地址" prop="cDepAddress">
        <el-input
          v-model="queryParams.cDepAddress"
          placeholder="请输入地址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="cDepMemo">
        <el-input
          v-model="queryParams.cDepMemo"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="信用额度" prop="iCreLine">
        <el-input
          v-model="queryParams.iCreLine"
          placeholder="请输入信用额度"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="信用等级" prop="cCreGrade">
        <el-input
          v-model="queryParams.cCreGrade"
          placeholder="请输入信用等级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="信用天数" prop="iCreDate">
        <el-input
          v-model="queryParams.iCreDate"
          placeholder="请输入信用天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="销售贡献等级" prop="cOfferGrade">
        <el-input
          v-model="queryParams.cOfferGrade"
          placeholder="请输入销售贡献等级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="销售贡献率" prop="iOfferRate">
        <el-input
          v-model="queryParams.iOfferRate"
          placeholder="请输入销售贡献率"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否零售" prop="bShop">
        <el-input
          v-model="queryParams.bShop"
          placeholder="请输入是否零售"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="成立日期" prop="dDepBeginDate">
        <el-date-picker clearable
          v-model="queryParams.dDepBeginDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择成立日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="撤销日期 " prop="dDepEndDate">
        <el-date-picker clearable
          v-model="queryParams.dDepEndDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择撤销日期 ">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="批准文号" prop="vAuthorizeDoc">
        <el-input
          v-model="queryParams.vAuthorizeDoc"
          placeholder="请输入批准文号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="批准单位" prop="vAuthorizeUnit">
        <el-input
          v-model="queryParams.vAuthorizeUnit"
          placeholder="请输入批准单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="传真" prop="cDepFax">
        <el-input
          v-model="queryParams.cDepFax"
          placeholder="请输入传真"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="邮政编码" prop="cDepPostCode">
        <el-input
          v-model="queryParams.cDepPostCode"
          placeholder="请输入邮政编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电子邮件" prop="cDepEmail">
        <el-input
          v-model="queryParams.cDepEmail"
          placeholder="请输入电子邮件"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="继承默认班次" prop="bInheritDutyBasic">
        <el-input
          v-model="queryParams.bInheritDutyBasic"
          placeholder="请输入继承默认班次"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="继承工作日历" prop="bInheritWorkCalendar">
        <el-input
          v-model="queryParams.bInheritWorkCalendar"
          placeholder="请输入继承工作日历"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="默认班次" prop="cDutyCode">
        <el-input
          v-model="queryParams.cDutyCode"
          placeholder="请输入默认班次"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="休息日方案" prop="cRestCode">
        <el-input
          v-model="queryParams.cRestCode"
          placeholder="请输入休息日方案"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否启用UTU" prop="bIM">
        <el-input
          v-model="queryParams.bIM"
          placeholder="请输入是否启用UTU"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="英文名称" prop="cDepNameEn">
        <el-input
          v-model="queryParams.cDepNameEn"
          placeholder="请输入英文名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="适用零售" prop="bRetail">
        <el-input
          v-model="queryParams.bRetail"
          placeholder="请输入适用零售"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门序号" prop="iDepOrder">
        <el-input
          v-model="queryParams.iDepOrder"
          placeholder="请输入部门序号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="分管领导" prop="cDepLeader">
        <el-input
          v-model="queryParams.cDepLeader"
          placeholder="请输入分管领导"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="修改时间" prop="dModifyDate">
        <el-date-picker clearable
          v-model="queryParams.dModifyDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择修改时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="${comment}" prop="cESpaceMembID">
        <el-input
          v-model="queryParams.cESpaceMembID"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['web:department:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['web:department:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['web:department:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['web:department:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="departmentList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="是否末级" align="center" prop="bDepEnd" />
      <el-table-column label="部门名称 " align="center" prop="cDepName" />
      <el-table-column label="编码级次" align="center" prop="iDepGrade" />
      <el-table-column label="负责人编码" align="center" prop="cDepPerson" />
      <el-table-column label="部门属性 " align="center" prop="cDepProp" />
      <el-table-column label="电话 " align="center" prop="cDepPhone" />
      <el-table-column label="地址" align="center" prop="cDepAddress" />
      <el-table-column label="备注" align="center" prop="cDepMemo" />
      <el-table-column label="信用额度" align="center" prop="iCreLine" />
      <el-table-column label="信用等级" align="center" prop="cCreGrade" />
      <el-table-column label="信用天数" align="center" prop="iCreDate" />
      <el-table-column label="销售贡献等级" align="center" prop="cOfferGrade" />
      <el-table-column label="销售贡献率" align="center" prop="iOfferRate" />
      <!-- <el-table-column label="时间戳" align="center" prop="pubufts" /> -->
      <el-table-column label="是否零售" align="center" prop="bShop" />
      <el-table-column label="全局ID" align="center" prop="cDepGUID" />
      <el-table-column label="成立日期" align="center" prop="dDepBeginDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dDepBeginDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="撤销日期 " align="center" prop="dDepEndDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dDepEndDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="批准文号" align="center" prop="vAuthorizeDoc" />
      <el-table-column label="批准单位" align="center" prop="vAuthorizeUnit" />
      <el-table-column label="传真" align="center" prop="cDepFax" />
      <el-table-column label="邮政编码" align="center" prop="cDepPostCode" />
      <el-table-column label="电子邮件" align="center" prop="cDepEmail" />
      <el-table-column label="部门类型 " align="center" prop="cDepType" />
      <el-table-column label="继承默认班次" align="center" prop="bInheritDutyBasic" />
      <el-table-column label="继承工作日历" align="center" prop="bInheritWorkCalendar" />
      <el-table-column label="默认班次" align="center" prop="cDutyCode" />
      <el-table-column label="休息日方案" align="center" prop="cRestCode" />
      <el-table-column label="是否启用UTU" align="center" prop="bIM" />
      <el-table-column label="英文名称" align="center" prop="cDepNameEn" />
      <el-table-column label="适用零售" align="center" prop="bRetail" />
      <el-table-column label="部门全称" align="center" prop="cDepFullName" />
      <el-table-column label="部门序号" align="center" prop="iDepOrder" />
      <el-table-column label="分管领导" align="center" prop="cDepLeader" />
      <el-table-column label="修改时间" align="center" prop="dModifyDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dModifyDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="${comment}" align="center" prop="cESpaceMembID" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['web:department:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['web:department:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改department对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="部门编码" prop="cDepCode">
          <el-input v-model="form.cDepCode" placeholder="请输入部门编码" />
        </el-form-item>
        <el-form-item label="是否末级" prop="bDepEnd">
          <el-input v-model="form.bDepEnd" placeholder="请输入是否末级" />
        </el-form-item>
        <el-form-item label="部门名称 " prop="cDepName">
          <el-input v-model="form.cDepName" placeholder="请输入部门名称 " />
        </el-form-item>
        <el-form-item label="编码级次" prop="iDepGrade">
          <el-input v-model="form.iDepGrade" placeholder="请输入编码级次" />
        </el-form-item>
        <el-form-item label="负责人编码" prop="cDepPerson">
          <el-input v-model="form.cDepPerson" placeholder="请输入负责人编码" />
        </el-form-item>
        <el-form-item label="部门属性 " prop="cDepProp">
          <el-input v-model="form.cDepProp" placeholder="请输入部门属性 " />
        </el-form-item>
        <el-form-item label="电话 " prop="cDepPhone">
          <el-input v-model="form.cDepPhone" placeholder="请输入电话 " />
        </el-form-item>
        <el-form-item label="地址" prop="cDepAddress">
          <el-input v-model="form.cDepAddress" placeholder="请输入地址" />
        </el-form-item>
        <el-form-item label="备注" prop="cDepMemo">
          <el-input v-model="form.cDepMemo" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="信用额度" prop="iCreLine">
          <el-input v-model="form.iCreLine" placeholder="请输入信用额度" />
        </el-form-item>
        <el-form-item label="信用等级" prop="cCreGrade">
          <el-input v-model="form.cCreGrade" placeholder="请输入信用等级" />
        </el-form-item>
        <el-form-item label="信用天数" prop="iCreDate">
          <el-input v-model="form.iCreDate" placeholder="请输入信用天数" />
        </el-form-item>
        <el-form-item label="销售贡献等级" prop="cOfferGrade">
          <el-input v-model="form.cOfferGrade" placeholder="请输入销售贡献等级" />
        </el-form-item>
        <el-form-item label="销售贡献率" prop="iOfferRate">
          <el-input v-model="form.iOfferRate" placeholder="请输入销售贡献率" />
        </el-form-item>
        <el-form-item label="是否零售" prop="bShop">
          <el-input v-model="form.bShop" placeholder="请输入是否零售" />
        </el-form-item>
        <el-form-item label="全局ID" prop="cDepGUID">
          <el-input v-model="form.cDepGUID" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="成立日期" prop="dDepBeginDate">
          <el-date-picker clearable
            v-model="form.dDepBeginDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择成立日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="撤销日期 " prop="dDepEndDate">
          <el-date-picker clearable
            v-model="form.dDepEndDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择撤销日期 ">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="批准文号" prop="vAuthorizeDoc">
          <el-input v-model="form.vAuthorizeDoc" placeholder="请输入批准文号" />
        </el-form-item>
        <el-form-item label="批准单位" prop="vAuthorizeUnit">
          <el-input v-model="form.vAuthorizeUnit" placeholder="请输入批准单位" />
        </el-form-item>
        <el-form-item label="传真" prop="cDepFax">
          <el-input v-model="form.cDepFax" placeholder="请输入传真" />
        </el-form-item>
        <el-form-item label="邮政编码" prop="cDepPostCode">
          <el-input v-model="form.cDepPostCode" placeholder="请输入邮政编码" />
        </el-form-item>
        <el-form-item label="电子邮件" prop="cDepEmail">
          <el-input v-model="form.cDepEmail" placeholder="请输入电子邮件" />
        </el-form-item>
        <el-form-item label="继承默认班次" prop="bInheritDutyBasic">
          <el-input v-model="form.bInheritDutyBasic" placeholder="请输入继承默认班次" />
        </el-form-item>
        <el-form-item label="继承工作日历" prop="bInheritWorkCalendar">
          <el-input v-model="form.bInheritWorkCalendar" placeholder="请输入继承工作日历" />
        </el-form-item>
        <el-form-item label="默认班次" prop="cDutyCode">
          <el-input v-model="form.cDutyCode" placeholder="请输入默认班次" />
        </el-form-item>
        <el-form-item label="休息日方案" prop="cRestCode">
          <el-input v-model="form.cRestCode" placeholder="请输入休息日方案" />
        </el-form-item>
        <el-form-item label="是否启用UTU" prop="bIM">
          <el-input v-model="form.bIM" placeholder="请输入是否启用UTU" />
        </el-form-item>
        <el-form-item label="英文名称" prop="cDepNameEn">
          <el-input v-model="form.cDepNameEn" placeholder="请输入英文名称" />
        </el-form-item>
        <el-form-item label="适用零售" prop="bRetail">
          <el-input v-model="form.bRetail" placeholder="请输入适用零售" />
        </el-form-item>
        <el-form-item label="部门全称" prop="cDepFullName">
          <el-input v-model="form.cDepFullName" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="部门序号" prop="iDepOrder">
          <el-input v-model="form.iDepOrder" placeholder="请输入部门序号" />
        </el-form-item>
        <el-form-item label="分管领导" prop="cDepLeader">
          <el-input v-model="form.cDepLeader" placeholder="请输入分管领导" />
        </el-form-item>
        <el-form-item label="修改时间" prop="dModifyDate">
          <el-date-picker clearable
            v-model="form.dModifyDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择修改时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="${comment}" prop="cESpaceMembID">
          <el-input v-model="form.cESpaceMembID" placeholder="请输入${comment}" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listDepartment, getDepartment, delDepartment, addDepartment, updateDepartment } from "@/api/department/department";

export default {
  name: "Department",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // department表格数据
      departmentList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        bDepEnd: null,
        cDepName: null,
        iDepGrade: null,
        cDepPerson: null,
        cDepProp: null,
        cDepPhone: null,
        cDepAddress: null,
        cDepMemo: null,
        iCreLine: null,
        cCreGrade: null,
        iCreDate: null,
        cOfferGrade: null,
        iOfferRate: null,
        pubufts: null,
        bShop: null,
        cDepGUID: null,
        dDepBeginDate: null,
        dDepEndDate: null,
        vAuthorizeDoc: null,
        vAuthorizeUnit: null,
        cDepFax: null,
        cDepPostCode: null,
        cDepEmail: null,
        cDepType: null,
        bInheritDutyBasic: null,
        bInheritWorkCalendar: null,
        cDutyCode: null,
        cRestCode: null,
        bIM: null,
        cDepNameEn: null,
        bRetail: null,
        cDepFullName: null,
        iDepOrder: null,
        cDepLeader: null,
        dModifyDate: null,
        cESpaceMembID: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询department列表 */
    getList() {
      this.loading = true;
      listDepartment(this.queryParams).then(response => {
        this.departmentList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        cDepCode: null,
        bDepEnd: null,
        cDepName: null,
        iDepGrade: null,
        cDepPerson: null,
        cDepProp: null,
        cDepPhone: null,
        cDepAddress: null,
        cDepMemo: null,
        iCreLine: null,
        cCreGrade: null,
        iCreDate: null,
        cOfferGrade: null,
        iOfferRate: null,
        pubufts: null,
        bShop: null,
        cDepGUID: null,
        dDepBeginDate: null,
        dDepEndDate: null,
        vAuthorizeDoc: null,
        vAuthorizeUnit: null,
        cDepFax: null,
        cDepPostCode: null,
        cDepEmail: null,
        cDepType: null,
        bInheritDutyBasic: null,
        bInheritWorkCalendar: null,
        cDutyCode: null,
        cRestCode: null,
        bIM: null,
        cDepNameEn: null,
        bRetail: null,
        cDepFullName: null,
        iDepOrder: null,
        cDepLeader: null,
        dModifyDate: null,
        cESpaceMembID: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.cDepCode)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加department";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const cDepCode = row.cDepCode || this.ids
      getDepartment(cDepCode).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改department";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.cDepCode != null) {
            updateDepartment(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDepartment(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const cDepCodes = row.cDepCode || this.ids;
      this.$modal.confirm('是否确认删除department编号为"' + cDepCodes + '"的数据项？').then(function() {
        return delDepartment(cDepCodes);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('web/department/export', {
        ...this.queryParams
      }, `department_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
